-- GENERATED SPELL FOR [Emeriss] --


function spell0_14889(pUnit, Event) --@Corruption of the Earth,Self--
pUnit:FullCastSpellOnTarget(24910,pUnit)
pUnit:RegisterEvent('Sorts_14889', 10000, 1)
end

function spell1_14889(pUnit, Event) --@Noxious Breath,Self--
pUnit:FullCastSpellOnTarget(24818,pUnit)
pUnit:RegisterEvent('Sorts_14889', 30000, 1)
end

function spell2_14889(pUnit, Event) --@Seeping Fog,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(24813,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_14889', 1, 1)
end

function spell3_14889(pUnit, Event) --@Seeping Fog,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(24814,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_14889', 1, 1)
end

function spell4_14889(pUnit, Event) --@Summon Player,n/a--
pUnit:FullCastSpellOnTarget(24776,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14889', 264, 1)
end

function spell5_14889(pUnit, Event) --@Tail Sweep,n/a--
pUnit:FullCastSpellOnTarget(15847,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14889', 589, 1)
end

function spell6_14889(pUnit, Event) --@Volatile Infection,n/a--
pUnit:FullCastSpellOnTarget(24928,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14889', 0, 1)
end

function Sorts_14889(pUnit, Event)
local choix_sorts_14889 = math.random(0, 6)
if choix_sorts_14889 == 0 then
pUnit:RegisterEvent('spell0_14889', 1, 1)
end
if choix_sorts_14889 == 1 then
pUnit:RegisterEvent('spell1_14889', 1, 1)
end
if choix_sorts_14889 == 2 then
pUnit:RegisterEvent('spell2_14889', 1, 1)
end
if choix_sorts_14889 == 3 then
pUnit:RegisterEvent('spell3_14889', 1, 1)
end
if choix_sorts_14889 == 4 then
pUnit:RegisterEvent('spell4_14889', 1, 1)
end
if choix_sorts_14889 == 5 then
pUnit:RegisterEvent('spell5_14889', 1, 1)
end
if choix_sorts_14889 == 6 then
pUnit:RegisterEvent('spell6_14889', 1, 1)
end
end

function mob14889_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_14889', math.random(1500, 3000), 1)
end

function mob14889_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14889_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14889_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(14889, 1, 'mob14889_Action')
RegisterUnitEvent(14889, 2, 'mob14889_Leave')
RegisterUnitEvent(14889, 3, 'mob14889_Kill')
RegisterUnitEvent(14889, 4, 'mob14889_Die')
